﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Luna;

namespace TextDataExtractor.DEML.Filters {
	class TypeConvertFilter : DemlElement, IDataFilter{

		public object applyFilter(ExecutionContext context, object input) {
			Type targetType = Type.GetType(getArgument("type"), false);
			if (targetType != null)
				input = input.ToString().convertTo(targetType);
			return input;
		}
	}
}
